import asyncio


# # coroutine used for a task
# async def task_coro(value):
#     while True:
#         # report a message
#         if value > 5:
#             raise Exception()
#             pass
#         else:
#             print(f'task {value} executing')
#         # sleep for a moment
#         await asyncio.sleep(1)
#
#
# # coroutine used for the entry point
# async def main():
#     # report a message
#     print('main starting')
#     # create many coroutines
#     coros = [asyncio.create_task(task_coro(i)) for i in range(10)]
#     # run the tasks
#     await asyncio.gather(*coros)
#     # report a message
#     print('main done')
#
# # start the asyncio program
# asyncio.run(main())




async def async_function_without_await():
    print("Start of async function")
    # No await or asynchronous code here
    print("End of async function")

async def main():
    print("Before calling async function")
    await async_function_without_await()
    print("After calling async function")

asyncio.run(main())